<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
    <style>
    div{
      text-align: center;
      height: 100px;
      line-height: 50px;
    }
  </style>
</head>
<body>
  <div>
      <input type="button" id="btn" value="查询">
  </div>
  
</body>
<script src="../jQuery/jquery-3.7.1.js"></script>
<script>
  var mybtn=$('#btn')
  mybtn.click(function(){
      $.ajax({
          type:"get",
          url:"/study/data.txt",
          data:{
          
          },
          dataType:"json",
          success:function(data){
            console.log(data);
            var ul=$('<ul></ul>')

            for (let i = 0; i < data.length; i++) {

              var li='<li>'+data[i].name+'</li>'
              ul.append(li);
            
            }
            $('body').append(ul);
          }
        })
  })


 

</script>
</html>